function n=verify2DPPInput(pp1,pp2)
%Check if the input is of valid size 2x(2n+1)x(n+1)
s1 = size(pp1);
s2 = size(pp2);

if (sum(s1-s2)~=0)
   error('pp1 and pp2 must have the size');
end

if (mod(s1(1),2)~=1) || (mod(s1(2),2)~=1)
   error('pp1 and pp2 must be of size (2n+1)x(n+1)');
end

n = [(s1(1)-1)/2;s1(2)-1];
if (n(1)~=n(2))
   error('Input parameter must be of size (2n+1)x(n+1)');
end